<?php
/**
 * author  :  hation
 *  email  : 331596350@qq.com
 * datetime: 2018/1/10 15:42
 */

namespace App\Http\Middleware;


use Closure;
use Illuminate\Support\Facades\Session;

class UserLoginReviewMiddleware
{
    public function handle($request, Closure $next)
    {
        $data=Session::get('review');
        if ($data===0||$data==2){
                return response()->view('user/user/user-review',compact('data'));
        }elseif ($data==1){
            if(Session::has('uid')){
                return $next($request);
            }else{
                return response()->view('user/user/login');
            }
        }else{
            return response()->view('user/user/login');
        }
    }
}